<?php
/**
 * 检查管理员是否登录
 * 
 * @author daniel
 */
class CheckUserBehavior extends Behavior
{
    protected $options = array(
        'WHITE_MODULE' => array('Index'),
    );
    
    public function run(&$params)
    {
        if (!in_array(MODULE_NAME, C('WHITE_MODULE')) && !PassportService::isLoggedInAdmin()) {
            redirect(U('Index/login'));
        }
    }
}